
<?php
	require_once 'imgMark.class.php';
	$demo_image= "";
	if(isset($_POST['createmark']) and $_POST['createmark'] == "Submit")
	{
		if(isset($_FILES))
		{
			$file_name = "new_image"; // You can Set File Name
			$file_path = "./images/"; // Set Path to Store Watermarked and Resized Images
			$image = new imgMark(); // Create New Object of imgMark Class
			
			$image->font_path = "arial.ttf"; // Font file
			$image->font_size = 15; // in pixels
			$image->water_mark_text = "http://sharp-coders.blogspot.com";  //WatermarkText
			$image->color = 'FFFFFF'; //text Color
			$image->opacity = 100; // Opacity of the Text
			$image->rotation = 65; // Text rotation (in Degree)
			$image->img_width = 400; // (Optional) If you want to resize image you can set maximum width
			$image->img_height = 400; // (Optional) If you want to resize image you can set maximum height
			// Here you have to user functins watermark_text or watermark_image
			if($image->convertImage('imgfile', $file_name, $file_path))
			$demo_image = $image->img_path;
		}
	}
?>
// Image Resize and Apply Watermark by Sharp Coders
<form name="imageUpload" method="post" enctype="multipart/form-data" >
Upload Image
Image :<input type="file" name="imgfile" /><br />
<input type="submit" name="createmark" value="Submit" />
</form>
// <a href="http://sharp-coders.blogspot.com">http://sharp-coders.blogspot.com</a>
<?php
if(!empty($demo_image))
echo '<img src="'.$demo_image.'" />';
?>

